public class Test1 {
    public static int firstUniqChar(String s) {
        int[] Count = new int[26];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            Count[ch - 'a']++;
        }//循环之后 Count[ch - 'a'] 是1的就是需要返回的下标
        for(int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if(Count[ch - 'a'] == 1) {
                return j;
            }
        }
        return -1;
    }
}
